<template>
	<view>
		<view class="banner">
			<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="3000" :interval="interval"
				:duration="duration">
				<swiper-item v-for="(item,index) in bannerList" :key="index">
					<view class="swiper-item uni-bg-red">
						<image :src="item.image_src" />
					</view>
				</swiper-item>
			</swiper>
		</view>
		<view class="bigtu">
			<view v-for="(item,index) in listList" :key="index">
				<view class="titleimg" >
					<image :src="item.floor_title.image_src" />
				</view>
				<view class="flotimg">
					<view class="imagetu">
						<image :src="item.product_list[0].image_src" />
					</view>
					<view class="imagexx">
						<image :src="item.product_list[1].image_src" />
						<image :src="item.product_list[2].image_src" />
						<image :src="item.product_list[3].image_src" />
						<image :src="item.product_list[4].image_src" />
					</view>

				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: ['color1', 'color2', 'color3'],
				indicatorDots: true,
				autoplay: true,
				interval: 2000,
				duration: 500,
				bannerList: [],
				listList: []
			}
		},
		methods: {
			dttz(item){
				console.log(item)
			},
			getList() {
				uni.request({
					url: "https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata",
					method: "GET",
				}).then((resp) => {
					this.bannerList = resp[1].data.message
				})
				uni.request({
					url: "https://api-hmugo-web.itheima.net/api/public/v1/home/floordata",
					method: "GET"
				}).then((res) => {
					console.log(res[1].data.message)
					this.listList = res[1].data.message
				})
			},
			changeIndicatorDots(e) {
				this.indicatorDots = !this.indicatorDots
			},
			changeAutoplay(e) {
				this.autoplay = !this.autoplay
			},
			intervalChange(e) {
				this.interval = e.target.value
			},
			durationChange(e) {
				this.duration = e.target.value
			}
		},
		created() {
			this.getList()
		}
	}
</script>

<style lang="scss">
	.titleimg {
		width: 100vw;
		height: 10vh;
	}

	.titleimg image {
		width: 100vw;
		height: 5vh;
	}

	.flotimg {
		display: flex;
	}

	.imagetu image {
		width: 150px;
		height: 250px;
	}

	.imagexx {
		display: flex;
		flex-wrap: wrap;
	}

	.imagexx image {
		width: 120px;
		height: 120px;
	}

	.banner {
		width: 100vw;
		height: 25vh;
	}

	.banner .swiper {
		width: 100vw;
		height: 25vh;
	}

	.banner image {
		width: 100vw;
		height: 25vh;
	}

	.uni-margin-wrap {
		width: 690rpx;
		width: 100%;
	}

	.swiper {
		height: 300rpx;
	}

	.swiper-item {
		display: block;
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
	}

	.swiper-list {
		margin-top: 40rpx;
		margin-bottom: 0;
	}

	.uni-common-mt {
		margin-top: 60rpx;
		position: relative;
	}

	.info {
		position: absolute;
		right: 20rpx;
	}

	.uni-padding-wrap {
		width: 550rpx;
		padding: 0 100rpx;
	}
</style>